<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="{ADMIN_THEME}images/reset.css" rel="stylesheet" type="text/css" />
<link href="{ADMIN_THEME}images/system.css" rel="stylesheet" type="text/css" />
<link href="{ADMIN_THEME}images/dialog.css" rel="stylesheet" type="text/css" />
<link href="{ADMIN_THEME}images/main.css" rel="stylesheet" type="text/css" />
<link href="{ADMIN_THEME}images/switchbox.css" rel="stylesheet" type="text/css" />
<link href="{ADMIN_THEME}luos/css/style.min.css?v=4.1.0" rel="stylesheet"><link href="{ADMIN_THEME}images/table_form.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{ADMIN_THEME}js/jquery.min.js"></script>{template admin/top.html}
<script type="text/javascript">
function del(id) {
	if(confirm('{lang('a-mod-16')}')){
		var url = "{url('admin/model/del/',array('typeid'=>$typeid))}&modelid="+id;
		window.location.href=url;
	}
}
function cdisabled(id, c) {
    if (c == 1) {
		var url = "{url('admin/model/cdisabled/',array('typeid'=>$typeid))}&modelid="+id;
		window.location.href=url;
		return true;
	}
	if (confirm('{lang('a-mod-17')}')) {
		var url = "{url('admin/model/cdisabled/',array('typeid'=>$typeid))}&modelid="+id;
		window.location.href=url;
	}
}
</script>
<title>admin</title>
</head>
<body>
<form action="" method="post">
<div class="subnav">
	<div class="content-menu ib-a line-x">
		<div class="layui-btn-group">
			<a class="layui-btn" href="{url('admin/model/index',  array('typeid'=>$typeid))}" class="on"><em>{lang('a-aut-14')}</em></a>
			{if admin_auth($userinfo['roleid'], 'model-add')}<a class="layui-btn" href="{url('admin/model/add', array('typeid'=>$typeid))}"><em>{lang('a-add')}</em></a>{/if}
			{if admin_auth($userinfo['roleid'], 'model-import')}<a class="layui-btn" href="{url('admin/model/import', array('typeid'=>$typeid))}"><em>{lang('a-import')}</em></a>{/if}
			{if admin_auth($userinfo['roleid'], 'model-cache')}<a class="layui-btn" href="{url('admin/model/cache', array('typeid'=>$typeid))}"><em>{lang('a-cache')}</em></a>{/if}
		</div>
	</div>
	<div class="bk10"></div>

	<div class="table-responsive mytable">
		<table width="100%" class="table table-striped">
			<thead>
			<tr>
				<th width="50" align="left">ID</th>
				<th width="130" align="left">{lang('a-mod-18')}</th>
				<th width="130" align="left">{lang('a-name')}</th>
				<th width="170" align="left">{lang('a-mod-19')}</th>
				<th align="left">{lang('a-option')}</th>
			</tr>
			</thead>
			<tbody>
			{loop $list $t}
			{php $setting=string2array($t['setting']);$disable = isset($setting['disable']) && $setting['disable'] == 1 ? 1 : 0;}
			<tr>
				<td align="left">{$t['modelid']}</td>
				<td align="left">{$typename[$t['typeid']]}</td>
				<td align="left">{$t['modelname']}</td>
				<td align="left">{php echo preg_replace('/\_([0-9]+)\_/', '_' . $siteid . '_', $t['tablename']);}</td>

				<td align="left">
                <div class="layui-btn-group">
				{if admin_auth($userinfo['roleid'], 'model-fields')}<a class="layui-btn layui-btn-small" href="{url('admin/model/fields/',array('typeid'=>$typeid, 'modelid'=>$t['modelid']))}">{lang('a-aut-18')}</a>{/if}
				{if admin_auth($userinfo['roleid'], 'model-edit')}<a class="layui-btn layui-btn-small layui-btn-normal" href="{url('admin/model/edit',array('typeid'=>$typeid,'modelid'=>$t['modelid']))}">{lang('a-edit')}</a>{/if}
				{if admin_auth($userinfo['roleid'], 'model-cdisabled')}<a class="layui-btn layui-btn-small layui-btn-warm" href="javascript:cdisabled({$t['modelid']}, {$disable});">{if $disable}<font color=red>{lang('a-qi')}</font>{else}{lang('a-jin')}{/if}</a>{/if}
				{if admin_auth($userinfo['roleid'], 'model-export')}<a class="layui-btn layui-btn-small" href="{url('admin/model/export',array('typeid'=>$typeid, 'modelid'=>$t['modelid']))}">{lang('a-export')}</a>{/if}
				{if admin_auth($userinfo['roleid'], 'model-del')}<a class="layui-btn layui-btn-small layui-btn-danger" href="javascript:del({$t['modelid']});">{lang('a-del')}</a> {/if}
                </div>
				</td>

			</tr>
			{/loop}
			<tbody>
		</table>
	</div>
</div>
</body>
</html>